import requests
from util.CurlUtils.curl_util import get_headers

headers = get_headers()


def queryTradeResult(params):
    """ 查询 无约束交易结果 """
    tradeSequenceId = params.get('tradeSequenceId')
    subTradetypeCode = params.get('subTradetypeCode')
    pageId = params.get('pageId')
    param = {
        "pageId": pageId,
        "tradeseqId": tradeSequenceId,
        "subTradetypeCode": subTradetypeCode
    }
    # 查询电量
    url = 'http://25.93.193.231:20080/px-trade-config/pageConfig/queryForPage'
    response = requests.post(url=url, headers=headers, data=params)
    data_list = []
    if response.status_code == 200:
        data_list = response.json().get('data')
    # 查询公共信息
    url = 'http://25.93.193.231:20080/px-trade-clearing/TrResultMainCalcuFeign/lookPubData'
    response = requests.post(url=url, headers=headers, data=params)
    data_list2 = []
    if response.status_code == 200:
        data_list2 = response.json().get('data')
    return data_list2
